<?php
namespace Wechat\Model;
use Think\Model\RelationModel;
class JoinModel extends RelationModel {
	
	protected $_link = array(
		'user'=>array(
			'mapping_type'      => self::BELONGS_TO,
			'class_name'        => 'user',
			'foreign_key'		=> 'uid',
			'mapping_fields'	=> 'nickname,headimgurl',
			'as_fields'			=> 'nickname:nickname,headimgurl:headimgurl',
			
		),
		'item'=>array(
			'mapping_type'      => self::BELONGS_TO,
			'class_name'        => 'item',
			'foreign_key'		=> 'sid',
			//'mapping_fields'	=> 'end',
			'as_fields'			=> 'title:title,content:content,start:start,regtime:regtime,end:end,address:address,number:number,baoming:baoming,bike:bike,image1:image1,difficulty:difficulty,meet:meet',
			
		),
		/*
		'image' => array(
			'mapping_type'      => self::HAS_MANY,
			'class_name'        => 'images',
			'foreign_key'   => 'sid',
			'mapping_fields' => 'url',
		),
		*/
		
		
	);
	
}